package com.navi.constant;

/**
 * Created by Jay on 2018/3/28.
 */
public class GenericDef {
    public static final Integer RETURN_SUCCESS=0;
    public static final Integer RETURN_FAISE=1;
    public static final Integer RETURN_REWORK_ALLCASE=2;
    public static final Integer RETURN_REWORK_THISCASE=3;



    public static final String PDS = "PDS";
    public static final String MDS = "MDS";
    public static final String COMMON = "COMMON";

    public static final String TRUE = "true";
    public static final String MODE_ERROR = "ERROR";
    public static final String MODE_NORMAL = "NORMAL";

    public static final String PATTERN_UNDERLINE2CAMEL = "([A-Za-z\\d]+)(_)?";

    /**
     * DB相关
     */
    public static final String SQL_STATE_UNIQUE_VIOLATION = "23505";
    public static final String SQL_STATE_NUMERIC_VALUE_OUT_OF_RANGE = "22003";
    public static final String TABLE_SCHEMA_SOR = "sor";
    public static final String TABLE_SCHEMA_EDA = "eda";
    public static final String TABLE_SCHEMA_DM = "dm";
    public static final String TABLE_SCHEMA_DEFECT = TABLE_SCHEMA_SOR;

    /**
     * table、Q相关
     */
    public static final String OPE_TBL_NAME = "ope_tbl_name";
    public static final String UNQ_SEQ_ID = "unqSeqId";

    public static final String JSON_ITEM_GLASS_ID = "glassId";
    public static final String JSON_ITEM_OPE_ID = "opeId";
    public static final String JSON_ITEM_EVT_TIMESTAMP = "evtTimestamp";
    public static final String JSON_ITEM_PROC_END = "procEnd";
    public static final String JSON_ITEM_FILE_URL = "fileUrl";

    public static final String EDC_DATA_TABLE_ERROR_Q_SUFFIX = "edc_data"; //TODO 命名不太好
    public static final String EDC_DATA_TABLE_PREFIX = EDC_DATA_TABLE_ERROR_Q_SUFFIX + "_";
    public static final String EDC_DATA_TABLE_DEFAULT_CONF = "edc_data_default-conf";

    public static final String HMS_ERROR_Q = "HMS_ERROR";
    public static final String HMS_ERROR_Q_BY_TABLE_PREFIX = HMS_ERROR_Q + "_";
    public static final String HMS_ERROR_Q_BY_TABLE = "HMS_ERROR_BY_TABLE";

    //批量捞取PDS Q 配置
    public static final String A_SUMMARY_P1 = "werp,aovn,mspu";
    public static final String A_SUMMARY_P2 = "ardv";
    public static final String A_SUMMARY_P3 = "nikn";
    public static final String A_SUMMARY_P4 = "dryt";
    public static final String A_SUMMARY_P5 = "strp,arco";
    public static final String A_SUMMARY_P6 = "itsp,wetx,cvda";
    public static final String F_SUMMARY_P1 = "itcv";
    public static final String F_SUMMARY_P2 = "cnvr";
    public static final String F_SUMMARY_P3 = "itbk,reet,samp";
    public static final String F_SUMMARY_P4 = "rest";
    public static final String C_SUMMARY_P1 = "assm";
    public static final String C_SUMMARY_P2 = "psva";
    public static final String C_SUMMARY_P3 = "pipr";
    public static final String C_SUMMARY_P4 = "pirp";
    public static final String C2_SUMMARY_P1 = "pzat";
    public static final String C2_SUMMARY_P2 = "csli";

    //批量捞取MDS Q 配置
    public static final String A_SUMMARY_I1 = "aoih";
    public static final String A_SUMMARY_I2 = "arco_a1,arco_a2,arco_a3,arco_a4,arco_a5";
    public static final String A_SUMMARY_I3 = "ardv_a1,ardv_a2,ardv_a3,ardv_a4,ardv_a5";
    public static final String A_SUMMARY_I4 = "atbo,cnvr_cx,fmac,sicv,tegx,werp";
    public static final String A_SUMMARY_I5 = "samp";
    public static final String F_SUMMARY_I1 = "cnvr_c1,cnvr_c2,cnvr_c3,cnvr_c4,cnvr_c7";
    public static final String F_SUMMARY_I2 = "insp1,insp2,insp_ito,insp_x";
    public static final String F_SUMMARY_I3 = "fmac,sicv,samp,samp_fmac";
    public static final String C_SUMMARY_I1 = "apin,oc1x,";
    public static final String C_SUMMARY_I2 = "assm,pipr";
    public static final String C2_SUMMARY_I1 = "aoix";
    public static final String C2_SUMMARY_I2 = "csli";
    public static final String C2_SUMMARY_I3 = "oc2x";
    public static final String C2_SUMMARY_I4 = "pzat";

    //    HISTORY HTML 配置
    public static final String EDA_PDS_GLASS_TABLE_DEFAULT_CONF_ARYCF = "eda_pds_glass_default-conf_arycf";
    public static final String EDA_PDS_GLASS_TABLE_DEFAULT_CONF_CELL1 = "eda_pds_glass_default-conf_cell1";
    public static final String EDA_PDS_GLASS_TABLE_DEFAULT_CONF_CELL2 = "eda_pds_glass_default-conf_cell2";
    public static final String EDA_PDS_GLASS_SUMMARY_TABLE_DEFAULT_CONF_ARYCF = "eda_pds_glass_summary_default-conf_arycf";
    public static final String EDA_PDS_GLASS_SUMMARY_TABLE_DEFAULT_CONF_CELL1 = "eda_pds_glass_summary_default-conf_cell1";
    public static final String EDA_PDS_GLASS_SUMMARY_TABLE_DEFAULT_CONF_CELL2 = "eda_pds_glass_summary_default-conf_cell2";
    public static final String EDA_PDS_RESULT_TABLE_DEFAULT_CONF_ARYCF = "eda_pds_result_default-conf_arycf";
    public static final String EDA_PDS_RESULT_TABLE_DEFAULT_CONF_CELL1 = "eda_pds_result_default-conf_cell1";
    public static final String EDA_PDS_RESULT_TABLE_DEFAULT_CONF_CELL2 = "eda_pds_result_default-conf_cell2";

    public static final String EDA_MDS_GLASS_TABLE_DEFAULT_CONF_ARYCF = "eda_mds_glass_default-conf_arycf";
    public static final String EDA_MDS_GLASS_TABLE_DEFAULT_CONF_CELL1 = "eda_mds_glass_default-conf_cell1";
    public static final String EDA_MDS_GLASS_TABLE_DEFAULT_CONF_CELL2 = "eda_mds_glass_default-conf_cell2";
    public static final String EDA_MDS_GLASS_SUMMARY_TABLE_DEFAULT_CONF_ARYCF = "eda_mds_glass_summary_default-conf_arycf";
    public static final String EDA_MDS_GLASS_SUMMARY_TABLE_DEFAULT_CONF_CELL1 = "eda_mds_glass_summary_default-conf_cell1";
    public static final String EDA_MDS_GLASS_SUMMARY_TABLE_DEFAULT_CONF_CELL2 = "eda_mds_glass_summary_default-conf_cell2";
    public static final String EDA_MDS_RESULT_TABLE_DEFAULT_CONF_ARYCF = "eda_mds_result_default-conf_arycf";
    public static final String EDA_MDS_RESULT_TABLE_DEFAULT_CONF_CELL1 = "eda_mds_result_default-conf_cell1";
    public static final String EDA_MDS_RESULT_TABLE_DEFAULT_CONF_CELL2 = "eda_mds_result_default-conf_cell2";

    //    pds glass 表名起始，特殊逻辑
    public static final String EDA_PDS_GLASS_TABLE_ARYCF = "array_pds_glass,cf_pds_glass";
    public static final String EDA_PDS_GLASS_TABLE_CELL1 = "cell_pds_glass";
    public static final String EDA_PDS_GLASS_TABLE_CELL2 = "cell2_pds_glass";
    public static final String ARYCF_PDS_GLASS_EQPT_T = "array_pds_glass_aoih_t";
    public static final String CELL1_PDS_GLASS_EQPT_T = "cell_pds_glass_pipr_t";
    public static final String CELL2_PDS_GLASS_EQPT_T = "cell2_pds_glass_aapk_t";

    public static final String EDA_MDS_GLASS_TABLE_ARYCF = "array_mds_glass,cf_mds_glass";
    public static final String EDA_MDS_GLASS_TABLE_CELL1 = "cell_mds_glass";
    public static final String EDA_MDS_GLASS_TABLE_CELL2 = "cell2_mds_glass";
    public static final String ARYCF_MDS_GLASS_EQPT_T = "array_mds_glass_aoih_t";
    public static final String CELL1_MDS_GLASS_EQPT_T = "cell_mds_glass_pipr_t";
    public static final String CELL2_MDS_GLASS_EQPT_T = "cell2_mds_glass_pzat_t";

    //pds summary 表名起始，特殊逻辑
    public static final String EDA_PDS_GLASS_SUMMARY_TABLE_ARYCF = "array_pds_glass_summary,cf_pds_glass_summary";
    public static final String EDA_PDS_GLASS_SUMMARY_TABLE_CELL1 = "cell_pds_compt_summary";
    public static final String EDA_PDS_GLASS_SUMMARY_TABLE_CELL2 = "cell2_pds_chip_summary";
    public static final String ARYCF_PDS_GLASS_SUMMARY_EQPT_T = "array_pds_glass_summary_aoih_t";
    public static final String CELL1_PDS_COMPT_SUMMARY_EQPT_T = "cell_pds_compt_summary_pipr_t";
    public static final String CELL2_PDS_CHIP_SUMMARY_EQPT_T = "cell2_pds_chip_summary_aapk_t";


    public static final String EDA_MDS_GLASS_SUMMARY_TABLE_ARYCF = "array_mds_glass_summary,cf_mds_glass_summary";
    public static final String EDA_MDS_GLASS_SUMMARY_TABLE_CELL1 = "cell_mds_compt_summary";
    public static final String EDA_MDS_GLASS_SUMMARY_TABLE_CELL2 = "cell2_mds_chip_summary";
    public static final String ARYCF_MDS_GLASS_SUMMARY_EQPT_T = "array_mds_glass_summary_aoih_t";
    public static final String CELL1_MDS_COMPT_SUMMARY_EQPT_T = "cell_mds_compt_summary_pipr_t";
    public static final String CELL2_MDS_CHIP_SUMMARY_EQPT_T = "cell2_mds_chip_summary_pzat_t";

    //pds result 表名起始，特殊逻辑
    public static final String EDA_PDS_RESULT_TABLE_ARYCF = "array_pds_result,cf_pds_result";
    public static final String EDA_PDS_RESULT_TABLE_CELL1 = "cell_pds_result";
    public static final String EDA_PDS_RESULT_TABLE_CELL2 = "cell2_pds_result";
    public static final String ARYCF_PDS_RESULT_EQPT_T = "array_pds_result_aoih_t";
    public static final String CELL1_PDS_RESULT_EQPT_T = "cell_pds_result_pipr_t";
    public static final String CELL2_PDS_RESULT_EQPT_T = "cell2_pds_result_aapk_t";


    public static final String EDA_MDS_RESULT_TABLE_ARYCF = "array_mds_result,cf_mds_result";
    public static final String EDA_MDS_RESULT_TABLE_CELL1 = "cell_mds_result";
    public static final String EDA_MDS_RESULT_TABLE_CELL2 = "cell2_mds_result";
    public static final String ARYCF_MDS_RESULT_EQPT_T = "array_mds_result_aoih_t";
    public static final String CELL1_MDS_RESULT_EQPT_T = "cell_mds_result_pipr_t";
    public static final String CELL2_MDS_RESULT_EQPT_T = "cell2_mds_result_pzat_t";

//    //defect_f_n
//    public static final String EDA_WPP_ADEFECT_F_N = "wpp_adefect_f_n";
//    public static final String EDA_WPP_FDEFECT_F_N = "wpp_fdefect_f_n";
//    public static final String EDA_WPP_CDEFECT_F_N = "wpp_cdefect_f_n";


    public static final String EDA_PREFIX = "eda_";

    //表名起始  time between 写法
    public static final String ARRAY_PDS_GLASS_SUMMARY = "array_pds_";
    public static final String CF_PDS_GLASS_SUMMARY = "cf_pds_";
    public static final String CELL_PDS_COMPT_SUMMARY = "cell_pds_";
    public static final String CELL2_PDS_CHIP_SUMMARY = "cell2_pds_";

    public static final String ARRAY_MDS_GLASS_SUMMARY = "array_mds_";
    public static final String CF_MDS_GLASS_SUMMARY = "cf_mds_";
    public static final String CELL_MDS_COMPT_SUMMARY = "cell_mds_";
    public static final String CELL2_MDS_CHIP_SUMMARY = "cell2_mds_";

//    public static final String ARRAY_PDS_GLASS_SUMMARY_Q = "array_pds_glass_summary_";
//    public static final String CF_PDS_GLASS_SUMMARY_Q = "cf_pds_glass_summary_";
//    public static final String CELL_PDS_COMPT_SUMMARY_Q = "cell_pds_compt_summary_";
//    public static final String CELL2_PDS_CHIP_SUMMARY_Q = "cell2_pds_chip_summary_";

    /**
     * Redis相关
     */
    // HMS的配置参数
    public static final String REDIS_HIS_CONFIG = "hisconfig";

    /**
     * Redis 处理成功的返回值（部分命令）
     */
    public static final String REDIS_RETURN_OK = "OK";

    /**
     * Redis key前缀
     */
    public static final String REDIS_KEY_SUFFIX = "HMS:";

    /**
     * Redis处理时需要分布式锁，避免Normal Q和Error Q进程同时处理造成锁表
     * Format : HMS:LOCK:tableName
     */
    public static final String REDIS_LOCK_KEY_FORMAT = REDIS_KEY_SUFFIX + "LOCK:%s";

    /**
     * 送Error Q时记录消息数据
     * Format : HMS:ERROR:routeKey
     */
    public static final String REDIS_ERROR_MESSAGE_KEY_FORMAT = REDIS_KEY_SUFFIX + "ERROR:%s";

    // defect处理详情
    public static final String REDIS_DEFECT_PROCESS_INFO = "DEFECT_PROCESS_INFO";

    /**
     * 打log相关
     */
    public static final String PRINT_PROCESS_COST = "Process-cost:";
    public static final String PRINT_PROCESS_COST_PERFORMANCE = "Performance";
    public static final String REDIS_OPE = "Redis-operation:";

    /**
     * subMainProc
     */
    public static final String LOG_SUB_MAIN_PROC = "subMainProc-";
    public static final String LOG_SUB_MAIN_PROC_SUM = LOG_SUB_MAIN_PROC + "SUM";
    public static final String LOG_SUB_MAIN_PROC_PPT = LOG_SUB_MAIN_PROC + "PPT"; //LOG_MERGE_PROC
    public static final String LOG_SUB_MAIN_PROC_HIS = LOG_SUB_MAIN_PROC + "HIS";
    public static final String LOG_SUB_MAIN_PROC_REAL_FLG = LOG_SUB_MAIN_PROC + "updateRealFlg";

    public static final String LOG_MSG_PROCESS_GET_MSG = "getMessage";
    public static final String LOG_MSG_PROCESS_GROUP = "groupMessage";

    public static final String LOG_WRITE_FILE_PROC = "writeFile-";
    public static final String LOG_WRITE_FILE_PROC_PROCESS_JSON = LOG_WRITE_FILE_PROC + "ProcessJsonToLine";
    public static final String LOG_WRITE_FILE_PROC_WRITE_FILE = LOG_WRITE_FILE_PROC + "writeFileToDisk";

    public static final String ACK = "ack";

    /**
     * GploaderService.mergeProc 函数使用
     */
    public static final String LOG_MERGE_PROC = "mergeProc-";
    public static final String LOG_MERGE_PROC_CS = LOG_MERGE_PROC + "createStatement";
    public static final String LOG_MERGE_PROC_GET_MATA = LOG_MERGE_PROC + "getTableMetaInfo";
    public static final String LOG_MERGE_PROC_WF = LOG_MERGE_PROC + "writeFile";
    public static final String LOG_MERGE_PROC_EXT = LOG_MERGE_PROC + "createExtTable";
    public static final String LOG_MERGE_PROC_STAGE = LOG_MERGE_PROC + "createStageTable";
    public static final String LOG_MERGE_PROC_LOOP_LIST = LOG_MERGE_PROC + "loop_json_list";
    public static final String LOG_MERGE_PROC_INSERT_STAGE = LOG_MERGE_PROC + "InsertStageTable";
    public static final String LOG_MERGE_PROC_PROCESS_FOR_OPE_HIS = LOG_MERGE_PROC + "prepareData4OpeHis";
    public static final String LOG_MERGE_PROC_INSERT = LOG_MERGE_PROC + "insert_records_not_existed";
    public static final String LOG_MERGE_PROC_DELETE_INSERT = LOG_MERGE_PROC + "delete_and_insert";
    public static final String LOG_MERGE_PROC_DELETE_INSERT_D = LOG_MERGE_PROC + "delete_and_insert-delete";
    public static final String LOG_MERGE_PROC_DELETE_INSERT_I = LOG_MERGE_PROC + "delete_and_insert-insert";
    public static final String LOG_MERGE_PROC_UPDATE = LOG_MERGE_PROC + "doUpdate";

    public static final String LOG_INSERT_STAGE_2_TARGET_TABLE = "insertStage2TargetTable";

    public static final String LOG_UPDATE_REAL_FLG = "updateRealFlg-";
    public static final String LOG_UPDATE_REAL_FLG_GET_MATA = LOG_UPDATE_REAL_FLG + "getTableMetaInfo";
    public static final String LOG_UPDATE_REAL_FLG_STAGE = LOG_UPDATE_REAL_FLG + "createStageTable";
    public static final String LOG_UPDATE_REAL_FLG_DELETE_INSERT = LOG_UPDATE_REAL_FLG + "updateTargetTableByStageTable-";
    public static final String LOG_UPDATE_REAL_FLG_DELETE_INSERT_INSERT_INTO_STAGR = LOG_UPDATE_REAL_FLG_DELETE_INSERT + "insertIntoStageTable";
    public static final String LOG_UPDATE_REAL_FLG_DELETE_INSERT_UPDATE_STAGE = LOG_UPDATE_REAL_FLG_DELETE_INSERT + "updateStageTable";
    public static final String LOG_UPDATE_REAL_FLG_DELETE_INSERT_DELETE_TARGET_TABLE = LOG_UPDATE_REAL_FLG_DELETE_INSERT + "deleteTargetTable";
    public static final String LOG_UPDATE_REAL_FLG_DELETE_INSERT_INSERT_INTO_TARGET_TABLE = LOG_UPDATE_REAL_FLG_DELETE_INSERT + "insertIntoTargetTableFromStageTable";


    //   OPE HIS real_flg 去重逻辑
    public static final String WPP_SHT_OPE_HIS_TABLE="wpp_asht_ope_his_n,wpp_fsht_ope_his_n,wpp_csht_ope_his_n";
    public static final String MDS_GLASS_TABLE="array_mds_glass_,cf_mds_glass_,cell_mds_glass_,cell2_mds_glass_";
    public static final String CHAMBER_HST_TABLE="array_chamber,cf_chamber,cell_chamber,cell2_chamber";

}
